Add file-level scanner for Linux kernel module (.ko) metadata - #5249
Open
OctavioValdiviaMendoza wants to merge 24 commits into
Open
Add file-level scanner for Linux kernel module (.ko) metadata#5249OctavioValdiviaMendoza wants to merge 24 commits into
OctavioValdiviaMendoza wants to merge 24 commits into
Conversation
Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu>
…ata using .modinfo section found in ELF files to yield the module macros Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu>
…s that are now passed to PackageData Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu>
…y DependecyPackage and PAckageData are structured correctly Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu>
Add Linux Kernel Module package parser Add support for parsing Linux Kernel Module (.ko) files. Add pyelftools as a runtime dependency for reading ELF .modinfo sections, register the new handler, and add unit tests.
OctavioValdiviaMendoza
force-pushed
the
feat/625-lkm-package-parser
branch
from
August 17, 2026 17:33
3d3746b to
1c40b49
Compare
TaslimOseni
force-pushed
the
feat/625-lkm-package-parser
branch
from
August 24, 2026 16:13
1c598fd to
385ce41
Compare
…km.py Add self to AUTHORS.rst Signed-off-by: diana-galeana <162429082+diana-galeana@users.noreply.github.com> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
In case of referenced license files, update the logic to not follow and de-reference licenses when all the license leys in the referenced files are already present in the main license detection. This preserves the license conditions in case there are extra license keys in an expression. Reference: aboutcode-org#3523 Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: Vincent Gao <gaobing1230@gmail.com> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Deprecate --ingore and --include pre-scan plugins and move the ignore/include functionality to codebase import stage to get rid of multiple codebase walks. Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
For multiple inputs, do not walk outside the input paths, from their common prefix. Instead create only the directory relationships between the common prefix and input paths and start the codebase walk from every input paths. Also deprecate --include options to only support ignoring paths through path patterns. Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Install commoncode from local source code instead of released commoncode so this can be installed/tested directly. Also add tests for released commoncode via azure pipelines. Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
…lugin Signed-off-by: Taslim Oseni <tasleemoseni@gmail.com> Signed-off-by: diana-galeana <dgaleana07@gmail.com>
diana-galeana
force-pushed
the
feat/625-lkm-package-parser
branch
from
August 26, 2026 06:34
385ce41 to
b2ec8e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #625
This PR adds file-level scanning of metadata embedded in compiled Linux Kernel Module (
.ko) files.Implementation
A new
LinuxKernelModuleScanneris implemented inscancode/plugin_lkm.pyusing ScanCode's file-levelScanPluginarchitecture.The scanner:
--lkmoption.pyelftoolsto open.kofiles as ELF files..modinfoELF section.key=valueentries.author,alias, andfirmwareas lists.linux_kernel_moduleattribute..modinfodependsvalue into a simple list of required kernel-module names.For example:
{ "linux_kernel_module": { "license": ["GPL"], "author": ["Example Author"], "depends": ["video", "backlight"] } }Tests
Test coverage includes:
Tasks